# -*- coding: utf-8 -*-

# Scrapy settings for script_test project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://doc.scrapy.org/en/latest/topics/settings.html
#     https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://doc.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = 'script_test'

SPIDER_MODULES = ['script_test.spiders']
NEWSPIDER_MODULE = 'script_test.spiders'


# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'script_test (+http://www.yourdomain.com)'

# Obey robots.txt rules
ROBOTSTXT_OBEY = False

# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://doc.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
#COOKIES_ENABLED = False

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
#DEFAULT_REQUEST_HEADERS = {
#   'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
#   'Accept-Language': 'en',
#}

# Enable or disable spider middlewares
# See https://doc.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
#    'script_test.middlewares.ScriptTestSpiderMiddleware': 543,
#}

# Enable or disable downloader middlewares
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
#    'script_test.middlewares.ScriptTestDownloaderMiddleware': 543,
#}
# from scrapy import  cmdline
#
# cmdline.execute('scrapy crawl baidu_ip'.split())
# Enable or disable extensions
# See https://doc.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    'scrapy.extensions.telnet.TelnetConsole': None,
#}

# Configure item pipelines
# See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
    # 300是优先级 数字越小优先级越高
    # 'script_test.pipelines.ScriptTestPipeline': 300,
    # 'script_test.pipelines.XdlPipeline': 1,
    # 'script_test.pipelines.CarPipeline': 1,
    # 'script_test.pipelines.ImgPipeline': 1,
    # 'script_test.pipelines.YuehuiPipeline' : 2,
    # 'script_test.pipelines.MysqlPipeline' : 3
    # 'script_test.pipelines.WangzheImgPipeline' : 1,
    # 'script_test.pipelines.WangzheMysqlPipeline': 2
    'script_test.pipelines.CnblogsPipeline':1
}
#下载那个字段
IMAGES_URLS_FIELD = "skin_url"
# 获取项目路径
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
IMAGES_STORE = os.path.join(BASE_DIR,'image')
# Enable and configure the AutoThrottle extension (disabled by default)
# See https://doc.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
COOKIE={"uuid_tt_dd":"10_17863348450-1524540940442-942874","Hm_ct_6bcd52f51e9b3dce32bec4a3997715ac":"1788*1*PC_VC","UM_distinctid":"163dee903bd14b-0e46c6a2a19253-444a022e-fa000-163dee903bec2","ADHOC_MEMBERSHIP_CLIENT_ID1.0":"046f5e1a-79fa-58b3-d2b6-2e90d70d96e3","__utma":"17226283.1525694722.1528805268.1528805268.1529138620.2","__utmz=17226283.1529138620.2.2.utmcsr=baidu|utmccn=(organic)|utmcmd":"organic","UN":"qq_37275405","UD":"%E6%89%80%E6%9C%89%E7%9A%84%E5%8A%AA%E5%8A%9B%E9%83%BD%E5%80%BC%E5%BE%97%E6%9C%9F%E8%AE%B8%EF%BC%8C%E6%AF%8F%E4%B8%80%E4%BB%BD%E6%A2%A6%E6%83%B3%E9%83%BD%E5%BA%94%E8%AF%A5%E7%81%8C%E6%BA%89%EF%BC%81","dc_session_id":"10_1529897540253.368819","TY_SESSION_ID":"bb30fad8-b4df-4772-9a10-fb55dad2fbbb","UserName":"qq_37275405","UserInfo":"fsHqBO%2F5vWG%2BwitAZJDQZlzFX7u8V0dqmhnSQtV3tbwcqb8eoBSbf8T8pOuGfZfqlBAK6VaQpWHKB6rhZx5ZnvRfbU7BlQUJSg1CLKrZDOz7cTAGQm5y1S7D%2FpOWjTZYYzV%2BI15hqQAskJAsM0H2og%3D%3D","UserNick":"%E7%8E%8B%E7%8E%8B%E7%8E%8B%E4%B8%89%E9%87%91","AU":"955","BT":"1529931658907","is_advert":"Mon%2C%2015%20Jan%202255%2013%3A44%3A03%20GMT","Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac":"1529983881,1530020655,1530020667,1530100656","smidV2":"2018062719573711dce17d6ad7cc70fc15c0b800c8221500fdd5ec76c1bf090","Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac":"1530105458","dc_tos":"pazgxi"}